﻿namespace EyeOpen.Domain
{
    using System;

    public abstract class HistoryEntity<T> : LogicalEntity where T : HistoryEntity<T>
    {
        protected HistoryEntity() 
        {
            if (!(this is T))
            {
                throw new Exception("The type of T must be the same of the class that own it.");
            }
        }

        public virtual DateTime Version
        {
            get;
            set;
        }

        public virtual T Previous
        {
            get;
            set;
        }
    }
}